% Calculate Neighbor pixels color distance
% Arguments:
%   cieluv: CIELUV representation of frame
%   height: Height of frame
%   width: Width of frame
function [info] = colordist(cieluv, height, width)
dist = zeros(height*width, 1);
cur = 0;
% Calculate distance to neighbor for each pixel
for i = 1:height
    for j = 1:width
        cur_dist = 0;
        % Consider each neighbor
        for di = -1:1
            for dj = -1:1
                if di ~= 0 || dj ~= 0
                    ii = i + di;
                    jj = j + dj;
                    if (ii < 1 || ii > height || jj < 1 || jj > width)
                        continue;
                    end
                    % Update current distance
                    cur_dist = cur_dist + norm(cieluv(i, j) - cieluv(ii, jj));
                end
            end
        end
        cur = cur + 1;
        dist(cur) = cur_dist;
    end
end
% Calculate features
a = sum(dist)/height/width;
b = std(dist);
c = min(dist);
d = max(dist);
mult = 100.0 / d;
info = [a*mult b*mult];
